package com.example.hello.controller;

import com.example.hello.bean.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.Map;

@Controller
public class ThymeleafController {
    @RequestMapping("/thy")
    public String myThymeleaf(Map<String,Object> result){
        result.put("user",new User("yan",61));
        ArrayList<User> list=new ArrayList<>();
        list.add(new User("yan01",62));
        list.add(new User("yan02",63));
        result.put("userList",list);
        return "thy";
    }
}
